*********************************************************************************
*** Figure 1
*********************************************************************************

* Project: 	European public opinion twd collective defence
* Authors: 	Matthias Mader
* Date:		Sep 2023	

* Data: VW Project, Post-Ukraine Survey, Pan-European survey (W1)

*********************************************************************************

*** Setup

	clear
	set more off            						// Disable partitioned output
	set dp period									// Use comma instead of dot for decimals
	set linesize 80         						// Line size limit to make output more readable
	macro drop _all         						// clear all macros
	set scheme plotplainblind, permanent				// set graph scheme, e.g., cleanplots, plottig, plotplainblind, burd3, s1mono
	graph set window fontface "Arial"				// set font in graphs | "Arial" | "Times New Roman"


*** Open Dynata data
use "DATA_clean.dta", clear


*** Perceptions of threat:
graph dot thr_RUS_d1_pre thr_RUS_d1_pre2 thr_RUS_d1_post, over(W1_QCOUNTRY, sort(thr_RUS_d1_post) label(labsize(med)) axis(noline) relabel(`r(relabel)')) ///
		name(F1, replace) ///
		marker(1, msize(large) msymbol(circle)	mcolor(eltblue%50)) /// w23: 2022
		marker(2, msize(large) msymbol(dot) 			mcolor(eltblue))   /// w22: 2021   
		marker(3, msize(large) msymbol(circle) 			mcolor(red))   /// w21: 2021   
		marker(4, msize(large) msymbol(circle) 			mfcolor(red%50)   mlcolor(red))   /// w17: 2021
		title("          Threat to the security of COUNTRY?:          " "Russia's territorial ambitions", size(med) box) /// Threat: Russia's territorial ambitions
		yscale(range(0 1)) ylabel(0 "0" .125 " " .25 "25" .375 " " .5 "50" .625 " " .75 "75" .875 " "1 "100", labsize(med)) ///
		ytitle("Perception of threat (%)", size(med)) ///
		ylab(,grid) ///
		legend(ring(1) position(6) row(1) order(1 "10/2020" 2 "5/2021" 3 "2/2023") size(med)) ///
		yline(.5) ///  
		plotregion(margin(zero) lcolor(black)) ///
		graphregion(margin(0 3 0 0)) ///
		xsize(4) ysize(4.5)

*** See Excel file
tab W1_QCOUNTRY, sum(thr_RUS_d1_post)
tab W1_QCOUNTRY, sum(thr_RUS_d1_pre2)
tab W1_QCOUNTRY, sum(thr_RUS_d1_pre)
